﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Vds2465Telegrams
{
    [TestClass]
    public class ReportType_State_Test
    {
        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test01_Equals()
        {
            ReportType_State reportTypeState = new ReportType_State(false, eReportSubType_State.DayMode);

            {
                // completely different type - NOT equal
                object dummyObject = new object();
                Assert.IsFalse(reportTypeState.Equals(dummyObject));
            }

            {
                // same type - same property values
                ReportType_State reportTypeState2compare = new ReportType_State(reportTypeState.OnOffFlag, reportTypeState.ReportSubType);
                Assert.IsTrue(reportTypeState.Equals(reportTypeState2compare));
            }

            {
                // same type - different OnOffFlag
                ReportType_State reportTypeState2compare = new ReportType_State(!reportTypeState.OnOffFlag, reportTypeState.ReportSubType);
                Assert.IsFalse(reportTypeState.Equals(reportTypeState2compare));
            }

            {
                // same type - different ReportSubType
                eReportSubType_State reportSubTypeState = eReportSubType_State.InternalArea;
                if (reportTypeState.ReportSubType == eReportSubType_State.InternalArea)
                {
                    reportSubTypeState = eReportSubType_State.RevisionState;
                }
                ReportType_State reportTypeState2compare = new ReportType_State(reportTypeState.OnOffFlag, reportSubTypeState);
                Assert.IsFalse(reportTypeState.Equals(reportTypeState2compare));
            }
        }

        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test02_GetHashCode()
        {
            ReportType_State reportTypeState = new ReportType_State(false, eReportSubType_State.SecurityArea);
            int hashCode01 = reportTypeState.GetHashCode();
        }

        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test03_ToString()
        {
            ReportType_State reportTypeState = new ReportType_State(true, eReportSubType_State.DayMode);
            string stringResult = reportTypeState.ToString();
            Assert.IsNotNull(stringResult);
        }
    }
}
